<template>
    <div class="container-content">
        <el-table
            v-loading="loading"
            ref="materialTable"
            :data="tableData"
            stripe
            border
            style="width: 100%"
            @selection-change="getSelectVal"
        >
         <el-table-column type="selection" width="55" align="center">
            </el-table-column>
             <el-table-column
          property="businessCode"
          label="编码"
          width="150"
        ></el-table-column>
        <el-table-column
          property="businessName"
          label="名称"
          width="200"
        ></el-table-column>
        <el-table-column property="address" label="形态"></el-table-column>
        <el-table-column property="address" label="核算组织"></el-table-column>
        <el-table-column
          property="address"
          label="核算组织类型"
          width="200"
        ></el-table-column>
        <el-table-column
          property="businessDept"
          label="业务组织"
        ></el-table-column>
        <el-table-column property="address" label="组织职能"></el-table-column>
        <el-table-column
          property="isEnabled"
          label="数据状态"
        ></el-table-column>
        <el-table-column property="describeInfo" label="描述"></el-table-column>
        <el-table-column property="address" label="联系人"></el-table-column>
        <el-table-column property="address" label="联系电话"></el-table-column>
        <el-table-column property="address" label="地址"></el-table-column>
        <el-table-column property="address" label="创建人"></el-table-column>
        <el-table-column property="address" label="创建日期"></el-table-column>
        <el-table-column property="address" label="修改人"></el-table-column>
        <el-table-column property="address" label="修改日期"></el-table-column>
        <el-table-column property="address" label="禁用状态"></el-table-column>
        <el-table-column property="address" label="禁用人"></el-table-column>
        </el-table>
        <el-pagination
            class="pagination mt10"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="page"
            :page-sizes="[10, 20, 30, 40]"
            :page-size="limit"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total"
            background
        >
        </el-pagination>
    </div>
</template>
<script>
import { getKingBaseBusinessGroupList } from "@/api/bim/bim";
export default {
    data() {
        return {
            tableData: [],
            page: 1, //当前页
            limit: 10, //每页条数
            total: 0,
            loading: false,
        };
    },
    methods: {
        //分页器size
        handleSizeChange(val) {
            this.limit = val;
            this.getDataList();
        },
        //分页器当前页
        handleCurrentChange(val) {
            this.page = val;
            this.getDataList();
        },
        getSelectVal(val) {
            // if (val.length) {
            this.$emit("update:visible", false);
            this.$emit("getSelectVal", val);
            // }
        },
        getDataList() {
            this.loading = true;
            let params = {
                page: this.page,
                limit: this.limit,
            };
            getKingBaseBusinessGroupList(params).then((res) => {
                this.loading = false;
                this.tableData = res.rows;
                this.total = res.total;
            });
        },
    },
    mounted() {
        this.getDataList();
    },
};
</script>
<style lang="scss" scoped></style>
